<?php

namespace App\Http\Controllers\Guard\Article;

use App\Http\Controllers\Common\CommonController;
use App\Models\Article\Word;
use Illuminate\Http\Request;

class WordController extends CommonController
{
    public function index(Request $request) {
        $pageSize = $request->input('pageSize',20);
        $page = $request->input('page',1);

        $conditions = $request->input();
        $conditions['orderBy']['col'] = 'count';
        $conditions['orderBy']['sort'] = 'desc';

        $records = (new Word())->getLst($conditions)->paginate($pageSize,$this->getCol,'page',$page);
        return responseSuccess($records->items(),$records->total());
    }
}
